﻿<%
 

Response.ContentType = "text/html"
Response.AddHeader "Content-Type", "text/html;charset=UTF-8"
Response.CodePage = 65001
Response.CharSet = "UTF-8"

Response.BinaryWrite( chrb(239) )
Response.BinaryWrite( chrb(187) )
Response.BinaryWrite( chrb(191) )

' Now write your XML data to output stream 
%>
 
<!--#include file="../Include/Common.Security.asp"-->
<!--#include file="../Include/MD5.asp"-->
<!--#include file="../Include/JSON_2.0.2.asp"-->
<!--#include file="../Include/JSON_UTIL_0.1.1.asp"-->
               <tr><td colspan="4"> 
                    <fieldset style="margin: 1em 0pt; padding: 1em;">
				<legend>兑换红包</legend>
                <table cellspacing="1" cellpadding="2" border="0" align="center">
                  <tbody><tr>
                    <td align="right">红包代码：</td>
                    <td width="300"><input type="text" maxlength="16" value="" id="code" class="text" name="code"/></td>
                  </tr>
                  <tr>
                    <td> </td>
                    <td><input type="submit" value="确认兑换"/> </td>
                  </tr>
                  <tr>
                    <td/>
                    <td><label id="get-result"/></td>
                  </tr>
                </tbody></table>
			</fieldset></td>
                  </tr>
							


<%
	'定义json对象
	Dim jsonObj,jsonObj_user,jsonObj_navg_list,jsonObj_temp
	Set jsonObj = jsObject()
	
	Set jsonObj_user = jsObject()
	''添加用户信息
	jsonObj_user("UserID") = ReplaceBadChar(Trim(Session("UserID"))) 
	jsonObj_user("UserName") =ReplaceBadChar(Trim(Session("UserName")))
	Set jsonObj("customer") = jsonObj_user 	
	
	Set jsonObj_navg_list =  jsArray()
	''添加导航信息


	Set jsonObj_navg_list(Null) = jsObject()
	jsonObj_navg_list(Null)("txt") = "我的控制台"
	jsonObj_navg_list(Null)("name") = "index"
	jsonObj_navg_list(Null)("href") = "/console/"
	Set jsonObj_temp =  jsArray()
	Set jsonObj_temp(Null) = jsObject()
	jsonObj_temp(Null)("txt")= "我的消息"
	jsonObj_temp(Null)("href")= "/console/center/message.php"
 	Set jsonObj_temp(Null) = jsObject()
	jsonObj_temp(Null)("txt")= "我的订单"
	jsonObj_temp(Null)("href")= "/console/center/sdfsdf.php"
	Set	jsonObj_navg_list(Null)("menu") = jsonObj_temp
	

	Set jsonObj_navg_list(Null) = jsObject()
	jsonObj_navg_list(Null)("txt") = "dfgdfgdfg"
	jsonObj_navg_list(Null)("name") = "index"
	jsonObj_navg_list(Null)("href") = "/console/"
	Set jsonObj_temp =  jsArray()
	Set jsonObj_temp(Null) = jsObject()
	jsonObj_temp(Null)("txt")= "我dfgdfg的消息"
	jsonObj_temp(Null)("href")= "/console/center/message.php"
 	Set jsonObj_temp(Null) = jsObject()
	jsonObj_temp(Null)("txt")= "我的hgjghjghj订单"
	jsonObj_temp(Null)("href")= "/console/center/sdfsdf.php"
	Set	jsonObj_navg_list(Null)("menu") = jsonObj_temp 
 
	
	Set jsonObj("navg_list") = jsonObj_navg_list 	
	
	
	
	
	
	'输出json对象
	jsonObj.Flush
	''Response.Write strSql&"-----"
	
%>
 
 
 
 
 <%
 			
''''''''''>>>>>>>>>>>>>测试log输出文件>>begin>>>>>>>>>''''''
	dim fs,fname
    set fs=Server.CreateObject("Scripting.FileSystemObject")
    set fname=fs.CreateTextFile("d:\temp\log_asp.txt",true)
    fname.WriteLine("====="&"XXXXXXXXX")
    fname.Close
	set fname=nothing
	set fs=nothing
''''''''''>>>>>>>>>>>>>测试log输出文件>>>end>>>>>>>>''''''
 %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--#include file="../Include/Start.asp"-->

<!--#include file="../Include/Common.All.asp"-->
<!--#include file="../Include/Common.Security.asp"-->
<!--#include file="../Include/CardMake.asp"-->

<html xmlns="http://www.w3.org/1999/xhtml">
 
 			<%
			
	 
Response.Write "--GetRndPassword-"

Response.Write GetRndPassword(11)
Response.Write "----GetNumString--"
Response.Write GetNumString()
Response.Write "----函数名：GetRndNum--"
Response.Write  GetRndNum(12)
Response.Write "----函数名： GetCardIdNum2String--"
Response.Write  GetCardIdNum2String()
			%>
 
 <%
 dim TrueName ,id_all, act,Spcode,Cardcode,spname,qycode  

		 
			id_all=ReplaceBadChar(Trim(request.Form("id_all")))
 			act=ReplaceBadChar(Trim(request.Form("act")))
			Spcode=ReplaceBadChar(Trim(request.Form("Spcode")))
			Cardcode=ReplaceBadChar(Trim(request.Form("Cardcode")))
			spname=ReplaceBadChar(Trim(request.Form("spname")))
			qycode=ReplaceBadChar(Trim(request.Form("qycode")))

if "make"=act then 
							dim max_num

						''Dim rsObj,strSql
						strSql = "select ISNULL(MAX(id), 0) as 'aaaaa' from HYKXH "
						max_num = Conn.Execute(strSql)(0)+1

						set rsObj=Server.CreateObject("ADODB.Recordset")
						strSql = "Select  * from HYKXH where 1=2 "
						rsObj.Open strSql, Conn, 1, 3
						If rsObj.BOF And rsObj.EOF Then
							rsObj.AddNew '如果没记录新增，有记录update					
							''rsObj("id") = max_num
						end If
						rsObj("Cardcode") = Cardcode
						rsObj("Spcode") =Spcode
				  	rsObj("spname") = spname      
				  	rsObj("sccs") = GetRndPassword(10)       
				  	rsObj("gg") = GetRndPassword(10)       
					
						rsObj("shangbiao") = GetRndPassword(10) 
						rsObj("scpc") = GetRndPassword(10)
	''					rsObj("scrq") = CDate(scrq)
	''					rsObj("dqsj") = CDate(dqsj)
						rsObj("sl") = 12     '数量
  ''      
	''					rsObj("dj") = dj	''单价
						rsObj("qycode") = qycode
	''					rsObj("gmrq") = CDate(gmrq)
						rsObj("jbr") = GetRndPassword(10)   

						rsObj("flag") = 1''数据来源(pos=1/个人=2)
						rsObj("state") = 1''状态 1正常/2申请退货/3退货成功
						rsObj.Update
						rsObj.close
						Set rsObj = Nothing

	
end if
 act="make"
 Response.Write  TrueName & "========"
 Response.Write  id_all & "========"
 
 
 
 
 ''Const PageNum = 10    
 
 dim page
 page="6"
 dim ttt
 ttt=PE_CLng(PageNum)*PE_CLng(page)-PE_CLng(PageNum)
 
  Response.Write  "==== ========="&CStr(PE_CLng(PageNum)*PE_CLng(page)-PE_CLng(PageNum))&"==="
 
 %>

<body>
 
<!--begin container-->
 
			<form action="tt.asp" method="post" id="form_edit">
				<input id="UserID" name="UserID" type="hidden" value="<%=UserID%>" />
  
		 
 
					<tr>
						<td align="right">真实名:</td>
						<td><input type="text" name="act" id="act"  value="<%=act%>" class="text"/></td>
						<td>Spcode--<input type="text" name="Spcode" id="Spcode"  value="<%=Spcode%>" class="text"/></td>
						<td>Cardcode--<input type="text" name="Cardcode" id="Cardcode"  value="<%=Cardcode%>" class="text"/></td>
						<td>spname--<input type="text" name="spname" id="spname"  value="<%="spname_"&GetRndPassword(5)%>" class="text"/></td>
						<td>qycode--<input type="text" name="qycode" id="qycode"  value="<%=qycode%>" class="text"/></td>
					</tr>
					<tr>
						<td align="center"><input type="checkbox" id="id_all" name="id_all" value="1" checked/></td>
						<td align="center"><input type="checkbox" id="id_all" name="id_all" value="2"/></td>
						<td align="center"><input type="checkbox" id="id_all" name="id_all" value="3"/></td>
						
					</tr>
					
					
					<tr>
 
						<td><input name="" type="submit" value="添加" />&nbsp;<label id="result"></label></td>
					</tr>
		 
			</form>
	 
 

 
</body>
</html>

<%

 
Response.Write  "1212" & "========"


Dim MyString, MyArray, Msg
MyString = "VBScriptXisXfun!"
MyArray = Split(MyString, "x", -1, vbTextCompare)
' MyArray(0) contains "VBScript".
' MyArray(1) contains "is".
' MyArray(2) contains "fun!".
Msg = MyArray(0) & " " & MyArray(1)  & " " & MyArray(2)
Response.Write  "----" & "========" & Msg
Response.Write  "-----" & "========  <br>     "  


 
 


dim zs_array1
zs_array1= Array(5,7,6,8,1,2,9,3,0,4)
dim zs_array2
zs_array2= Array(9,6,1,4,5,7,2,8,3,0)
dim zs_array
zs_array= Array(Array(5,7,6,8,1,2,9,3,0,4),Array(9,6,1,4,5,7,2,8,3,0))
 
Response.Write "<br>" & "+_______      "  
        For j = 0 to Ubound(zs_array(i))
                Response.Write(j&"")
        Next
For i = 0 to Ubound(zs_array)
Response.Write "<br>"& i & "_______      "  
        For j = 0 to Ubound(zs_array(i))
                Response.Write(zs_array(i)(j)&"")
        Next
Next
Response.Write "<br>" & "_______      "  
Response.Write "<br>" & "_______      "  &join(zs_array(0))
Response.Write "<br>" & "_______      "  &join(zs_array(0),"")

dim str_kahao,str_kahao1,str_kahao2
str_kahao ="0912171345203617"
str_kahao ="5476737812658973"
str_kahao ="9061686457194268"
Response.Write "<br>" & "_______  str_kahao=    "  & str_kahao  
dim K1
K1=(10- (Cint( mid(str_kahao,1,1))+Cint( mid(str_kahao,3,1))+Cint( mid(str_kahao,5,1))+Cint( mid(str_kahao,7,1))+Cint( mid(str_kahao,9,1))+Cint( mid(str_kahao,11,1))+Cint( mid(str_kahao,13,1))+Cint( mid(str_kahao,15,1))+3*(Cint( mid(str_kahao,2,1))+Cint( mid(str_kahao,4,1))+Cint( mid(str_kahao,6,1))+Cint( mid(str_kahao,8,1))+Cint( mid(str_kahao,10,1))+Cint( mid(str_kahao,12,1))+Cint( mid(str_kahao,14,1))+Cint( mid(str_kahao,16,1)))) mod 10) mod 10
K1=   Cint( mid(str_kahao,1,1))+Cint( mid(str_kahao,3,1))+Cint( mid(str_kahao,5,1))+Cint( mid(str_kahao,7,1))+Cint( mid(str_kahao,9,1))+Cint( mid(str_kahao,11,1))+Cint( mid(str_kahao,13,1))+Cint( mid(str_kahao,15,1))+3*(Cint( mid(str_kahao,2,1))+Cint( mid(str_kahao,4,1))+Cint( mid(str_kahao,6,1))+Cint( mid(str_kahao,8,1))+Cint( mid(str_kahao,10,1))+Cint( mid(str_kahao,12,1))+Cint( mid(str_kahao,14,1))+Cint( mid(str_kahao,16,1))) 



Response.Write "<br>" & "_______  K1=    "  & K1  
Response.Write "<br>" & "_______    "   


str_kahao1=""
str_kahao2=""
For I=1 To len(str_kahao)
	str_kahao1=str_kahao1&""& zs_array(0)( Cint( mid(str_kahao,i,1)))
	str_kahao2=str_kahao2&""& zs_array(1)( Cint( mid(str_kahao,i,1)))
	''Response.Write " " & i& "->" & Cint( mid(str_kahao,i,1))
	''Response.Write  "   "& Cint( mid(str_kahao,i,1))&"_"& zs_array(0)( Cint( mid(str_kahao,i,1)))
Next
Response.Write  " <br>++++"&str_kahao1
Response.Write  " <br>++++"&str_kahao2


 
Response.Write "<br>" & "_______      "  


%>


 设第n位卡号数字为 E(n)，那么计算公式如下：
X1=E(2)+E(4)+E(6)+E(8)+E(10)+E(12)+E(14)+E(16)
U1=3*X1
Y1=E(1)+E(3)+E(5)+E(7)+E(9)+E(11)+E(13)+E(15)
Z1=U1+Y1
H1=Z1的个位数
K1=(10-H1)的个位数
++++5476737812658973
++++9061686457194268